
/**
 * @Title: TestController.java
 * @Package net.austars.controller
 * @Description: 
 * Copyright: Copyright (c) 2018
 * @Author 4049477516@qq.com
 * @DateTime 2020年4月18日 下午4:11:49
 */
package net.austars.controller;

import net.austars.dao.first.UserRepository;
import net.austars.dao.second.User2Repository;
import net.austars.entity.first.User;
import net.austars.entity.second.User2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;
import java.util.Optional;

/**
 * @Title: TestController.java
 * @Package net.austars.controller
 * @Description: 
 * Copyright: Copyright (c) 2018
 * @Author 409477516@qq.com
 * @DateTime 2020年4月18日 下午4:11:49
 */
/**
 * @ClassName: TestController
 * @Description: 
 * @Author 409477516@qq.com
 * @DateTime 2020年4月18日 下午4:11:49 
 */
@RestController
public class TestController {
	@Autowired
	private UserRepository firstDao;
	@Autowired
	private User2Repository secondDao;
	@RequestMapping("/get")
	public Map<String,Object> getTest() {
		Optional<User> findById = firstDao.findById(3);
		User first = findById.get();
		Optional<User2> findById1 = secondDao.findById(4);
//		Second second = findById1.get();
		Map<String,Object>map=new HashMap<String,Object>();
		map.put("first",first);
		map.put("second",findById1);
		return map;
	}
}
